Blue sky color detection technique

ABSTRACT

An image enhancement technique includes a filter that receives an input image and provides a low-pass filtered image that maintains a substantial number of edges therein. The low pass filtered image is provided a likelihood of being a sky color for each pixel of the low pass filtered image. The low-pass filtered image is filtered based upon a user selection to selectively enhance the sky color. The low-pass filtered image and the filtered low-pass filtered image are blended based upon the user selection based upon the likelihood. The blended image is combined with a high pass filtered input image to provide an enhanced image.

CROSS-REFERENCE TO RELATED APPLICATIONS

Not applicable.

BACKGROUND OF THE INVENTION

The present invention relates to a blue sky color detection technique.

Sky is an important subject matter seen in photographic images. The identification of sky in images facilitates its enhancement and image manipulation.

The most prominent characteristic of sky tends to be its color, which is usually light blue when the sky is clear. Such a characteristic has been used to detect sky in images.

There exists conventional techniques of enhancing the color of a color image. One technique involves image-dependent color saturation correction in a natural scene pictorial image disclosed in U.S. Pat. No. 5,450,217. In this method, color saturation is enhanced in an HSV color space, which is considered as being capable of representing an image to have almost the same saturation as a recognized saturation of the image. However, this method can enhance the color saturation of certain images only, which have an average saturation of no higher than a certain threshold value.

The foregoing and other objectives, features, and advantages of the invention will be more readily understood upon consideration of the following detailed description of the invention, taken in conjunction with the accompanying drawings.

BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWINGS

FIG. 1 illustrates a sky detection technique.

FIG. 2 illustrates a set of image used to determine sky colors.

FIG. 3 illustrates look up table generation.

FIG. 4 illustrates a hue, saturation, value chart.

FIG. 5 illustrates a weight function used to pull down the score of low-luminance blue color.

FIG. 6 illustrates a two dimensional LUT at blue-cyan region.

FIG. 7 illustrates a two dimensional LUT at blue-magenta region.

FIG. 8 illustrates a two dimensional LUT at green-cyan region.

FIG. 9 illustrates a two dimensional LUT at green-yellow, red-yellow, and red-magenta region.

FIG. 10 illustrates the color gamut in the x-y chart and sky score of its colors.

FIG. 11 illustrates the IIR filtering on sky color likelihood map.

FIG. 12 illustrates modification of the output based upon user adjusted parameter input.

DETAILED DESCRIPTION OF PREFERRED EMBODIMENT

A diagram illustrating a sky detection technique 10 is illustrated in FIG. 1. It is desirable to enhance the color of the sky in a manner that is visually appealing to the viewer, such as for example, increasing the saturation of the sky. However, it is likewise desirable to do this enhancement in a manner that does not simultaneously unnecessarily increase the noise and artifacts in the image which may be objectionable to the viewer. To reduce increasing the noise and artifacts while simultaneously enhancing sky regions, a two-channel decomposition technique may be used. The two-channel decomposition technique spatially decomposes the input image 15 into a low pass image and a high pass image by using a spatial filter 20, such as a sigma filter. The low pass spatial image tends to include sky regions which are generally low frequency content. The output of the spatial filter 20 is a lowpass image 30. The high-pass image 40 may be created by subtracting 35 the low pass image 30 from the input image 15.

The low pass image, containing fewer details and artifacts which may be representative of sky regions is passed through an image enhancement technique so the image is more visually appealing to the viewer. The high pass image, containing high frequency details and artifacts is not passed through a similar enhancement technique so as avoid enhancing such artifacts which may be objectionable to the viewer. In this manner, the spatial regions of the image tending to include limited amount of details and noise and sky regions are enhanced, while the spatial regions of the image tending to include artifacts, noise and details are not similarly enhanced.

As previously noted, the sigma filter 20 decomposes the input image into the low pass image 30 and the high pass image 40. The sigma filter utilizes a one dimensional or two dimensional rectangular window, where the current pixel I(x,y) is at the center of the window. The sigma filter compares all (or a selected set of) the pixels I(i,j) in the window with the central pixel I(x,y) (or other suitable pixel), and averages those pixels whose value differences with the central pixel I(x,y) is within a threshold T. Because the filter drops pixels that are not within the threshold, this filter is generally referred to as a sigma filter and is non-linear. Mathematically, the output of the sigma filter 30, I_(LP)(x,y), may be calculated as follows:

${I_{LP}\left( {x,y} \right)} = \frac{\sum\limits_{{{{{({i,j})} \in E}\&}{{{I{({i,j})}} - {I{({x,y})}}}}} < T}{I\left( {i,j} \right)}}{N\left( {x,y} \right)}$ where E is the window; N(x,y) is the count of the pixels in E that satisfy the condition of |I(i,j)−I(x,y)|<T. The parameters of the sigma filter, the widow E and the threshold T, may be chosen using any technique, such as being selected empirically.

Because the sigma filter is also a smoothing filter preserving sharp edges, the low pass image generated by a sigma filter contains few high frequency details but does contain sharp edges, and the high pass image therefore contains details, noises, and artifacts but few sharp edges. The low-pass image, in general, tends to resemble a cartoon image. The preservation of sharp edges tends to assist in the identification of those regions that are likely to be sky colors.

Sky color detection 50 is based upon the low-pass image 30 from the sieve filter 20. Referring to FIG. 3, the sky color detection 50 may be based upon a sky color probability 100 which is the probability that a particular color (represented by HSV color space or RGB color space or other color space) is a sky color. The sky color probability 100 may be for a predefined set of colors or other basis. However, it is preferable that the sky color probability 100 is based upon a training set of images by computing the color histogram of segmented sky regions from those training images. One exemplary sky color probability is based upon a set of sample images, such as those illustrated in the FIG. 2. The sky color probability 100 is preferably not directly used as the sky score used in the sky color detection 50. The reason is that, first, the three dimensional sky color probability 100 contains abrupt changes in the color space, and it may also contain holes, both of which will lead to a rough output. Thus, the sky color probability distribution provides a useful informational baseline for roughly deciding the location and size of the sky color region in the color space. Second, due to the inherent limited number of training sky images, some sky colors might not appear in the training set, therefore these colors will have low probability in the learned probability set.

The sky color probability 100 is used to initialize a sky score look up table 110. The entries in the look up table 110 are adjusted based upon testing on a large set of sky and non-sky images. The adjustment of the look up table 110 involves fine tuning the sky score look up table 120, generating sky color likelihood map using the sky score look up table 130, and repeating the process until a suitable sky score look up table is created. The resulting sky score look up table is used as the basis for the sky color detection 50.

If the system directly uses the RGB color space for the look up tables, such as the table for the sky color detection 50, then the system would incorporate a three dimensional LUT. It is computationally complex to adjust a three dimensional LUT. To reduce the computational complexity it is desirable to modify the RGB color space to a different color space, such as the HSV (hue, saturation, value) color space. With the color space modification, the three dimensional lookup table may be replaced by four two-dimensional look up tables and two one-dimensional look up tables. It is more computationally efficient to adjust multiple two dimensional and one dimensional look up tables than a single three dimensional look up table.

One technique to modify the color space is to first divide the RGB color space into six areas, and then define hue (H), saturation (S) and value (V) separately in the six areas (note that while S and V are defined by the typical definition, H here has a nonstandard definition), and then define the sky score for each area. The blue-cyan area is described in detailed with the remaining areas being similar. The six color areas and S and H are illustrated in FIG. 4.

The blue-cyan 300 (blue>green>red), may be defined as follows:

$S = \frac{b - r}{b}$ $H = \frac{g - r}{b - r}$ V = b

S and H are between 0 and 1. When S is 0, r=g=b and the color is the white; when S is 1, r is 0 and the color is most saturated. When H is 0, g=r and the color is blue; when H is 1, g=b and the color is cyan.

The sky score may be modeled by the following equation: skyScore_(RY)(H,S,V)=ƒ_(BC)(S,H)·w(V)

Where ƒ_(BC)(S,H) models LUT function based on the S and H, and it is given by: ƒ_(BC)(S,H)=((b−r)*p(b),(g−r)*q(b−r))

The above equation may be implemented by concatenation of one dimensional LUTs and two dimensional LUTs. The calculation uses one two dimensional LUTs for ƒ_(BC)(•,•), and two one dimensional LUTs for p(•) and q(•).

Calculating the sky score solely based on S and H may not reflect the true sky likelihood. For instance, if sky score is solely based on H and S, some low-luminance blue colors (Vis small and B>R&B>G, e.g. [R G B]=[45 47 50]) will typically receive very high sky score which should not be the case since perceptually these colors will look like black and therefore sky score shall be low such that only small saturation boosting is enforced. In this case the second component w(V) plays a role to pull down the high score assigned to the low-luminance blue colors. w(V) may be given as:

${w(V)} = \left\{ \begin{matrix} {0,} & {V < V_{0}} \\ {{{linear}\mspace{14mu}{function}\mspace{14mu}{of}\mspace{14mu} V},} & {V_{0} \leq V \leq V_{1}} \\ {1,} & {V > V_{1}} \end{matrix} \right.$

One embodiment of the w(V) is shown in FIG. 5. This form of the w(V) allows a linear, smooth transition of the sky score when V falls into [V₀ V₁]. Generally, one may can also use other nonlinear functions (like power function) to model w(V).

The two dimensional LUT ƒ_(BC)(•,•) is illustrated in FIG. 6 where the x-axis is the first argument S, and they-axis is the second argument H. White: 1; black: 0; gray: between 0 and 1.

The blue-magenta 310 (blue>red>green) may be defined as follows:

$\begin{matrix} {\mspace{79mu}{{S = \frac{b - g}{b}}\mspace{79mu}{H = \frac{r - g}{b - g}}\mspace{79mu}{V = b}{{{skyScore}_{BM}\left( {H,S,V} \right)} = {{f_{BM}\left( {{\left( {b - g} \right)^{*}{p(b)}},{\left( {r - g} \right)^{*}{q\left( {b - g} \right)}}} \right)} \cdot {w(V)}}}}} & (6) \end{matrix}$

The calculation uses a different two dimensional LUT for ƒ_(BM)(•,•), the same two one dimensional LUTs for p(•) and q(•) and the same w(V). The two dimensional LUT ƒ_(BM)(•,•) is illustrated in FIG. 7. The x-axis is the first argument S, and they-axis is the second argument H. White: 1; black: 0; gray: between 0 and 1.

The green-cyan 320 (green>blue>red), may be defined as follows:

$\mspace{79mu}{S = \frac{g - r}{g}}$ $\mspace{79mu}{H = \frac{b - r}{g - r}}$      V = g skyScore_(GC)(H, S, V) = f_(GC)((g − r)^(*)p(g), (b − r)^(*)q(g − r)) ⋅ w(V)

The calculation uses a two dimensional LUT for ƒ_(GC)(•,•) and the same two one dimensional LUTs for p(•) and q(•). The two dimensional LUT ƒ_(GC)(•,•) is illustrated in FIG. 8 where the two dimensional LUT for ƒ_(GC)(•,•). The x-axis is the first argument S, and they-axis is the second argument H. White: 1; black: 0; gray: between 0 and 1.

The green-yellow 330 (green>red>blue), may be defined as follows:

$\mspace{79mu}{S = \frac{g - b}{g}}$ $\mspace{79mu}{H = \frac{r - b}{g - b}}$      V = g skyScore_(GY)(H, S, V) = f_(GY)((g − b)^(*)p(g), (r − b)^(*)q(g − b)) ⋅ w(V)

The calculation uses a two dimensional LUT for ƒ_(GY)(•,•) and the same two one dimensional LUTs for p(•) and q(•). The two dimensional LUT ƒ_(GY)(•,•) is illustrated in FIG. 9 where the two dimensional LUT ƒ_(GY)(•,•), ƒ_(RY)(•,•), ƒ_(RM)(•,•). The x-axis is the first argument S, and the y-axis is the second argument H. White: 1; black: 0; gray: between 0 and 1.

The red-yellow 340 (red>green>blue), may be defined as follows:

$S = \frac{r - b}{r}$ $H = \frac{g - b}{r - b}$ V^(′) = r skyScore = f_(RY)((r − b)^(*)p(r), (g − b)^(*)q(r − b)) ⋅ w(V)

The calculation uses a two dimensional LUT for ƒ_(RY)(•,•)=ƒ_(GY)(•,•) and the same two one dimensional LUTs for p(•) and q(•).

The two dimensional LUT ƒ_(RY)(•,•) is illustrated in FIG. 9. In this case, ƒ_(RY)(•,•) and ƒ_(GY)(•,•) are the same.

The red-magenta 350 (red>blue>green), may be defined as follows:

$\mspace{79mu}{S = \frac{r - g}{r}}$ $\mspace{79mu}{H = \frac{b - g}{r - g}}$      V = r skyScore_(RM)(H, S, V) = f_(RM)((r − g)^(*)p(r), (b − g)^(*)q(r − g)) ⋅ w(V)

The calculation uses a 2D LUT for ƒ_(RM)(•,•)=ƒ_(RY)(•,•)=ƒ_(GY)(•,•) and the same two 1D LUTs for p(•) and q(•).

The two dimensional LUT •_(RM)(•,•) is illustrated in FIG. 9 where the two dimensional LUT for ƒ_(GY)(•,•), ƒ_(RY)(•,•), ƒ_(RM)(•,•). The x-axis is the first argument S, and the y-axis is the second argument H. White: 1; black: 0; gray: between 0 and 1.

The sky score for the sRGB color gamut is illustrated in two dimensions in FIG. 10 (can we use a color version of FIG. 10 a?). One may notice most sky colors are in the blue-cyan and blue-magenta areas.

The sky color detection 50 thus creates a sky color likelihood map 60 based upon the lowpass image 30 in combination with the two dimensional and one dimensional sky score look up tables 130. In general, the process for the sky color detection 50 is a pixel by pixel analysis of the lowpass image 30. However, if desired, the sky color detection 50 could include a spatial analysis.

The sky color likelihood map 60 tends to be not smooth which may cause undesirable artifacts (such as contouring artifacts) in the saturation-enhanced sky images 220. The system may use a filter 70, such as an image-driving non-linear lowpass filter to smooth the sky color likelihood map 60 to reduce potential contouring artifacts. Referring to FIG. 11, to provide a computationally efficient filter, preferably an infinite impulse response (e.g., IIR) filter is used. Specifically, the filter 70 may be defined as:

sky  score(x, y) = a₀^(*)sky  score(x, y) + a₁^(*)sky  score  (x − 1, y) + a₂^(*)sky  score(x − 2, y) + a₃^(*)sky  score(x − 2, y − 1) + a₄^(*)sky  score(x − 1, y − 1) + a₅^(*)sky  score(x, y − 1) + a₆^(*)sky  score(x + 1, y − 1) + a₇^(*)sky  score(x + 2, y − 1) where x is the row index, y is the column index, and α₀+α₁+α₂+α₃+α₄=1. The IIR filter may be implemented in such a manner that it only uses a one line buffer for the sky score, without requiring life buffers for the RGB.

An adjustable color enhancement 80 for the sky color may be performed. Referring to FIG. 12, the adjustment technique receives the lowpass image 30 and adjusts the lowpass image 30 based upon a user adjustment 85 that includes a matrix operation 90 and a DC offset 95.

The 3×3 matrix 90 and the DC offset 95 are generated by users according to their preference, and received by the system. There are many techniques that may be used to adjust the 3×3 matrix and DC offset. As a preferred embodiment, users can adjust hue, saturation and brightness in the YCbCr space, and then the adjustment parameters are converted to a new 3×3 matrix and DC offset. In this case, the 3×3 conversion matrix can be express as follows where a represents the luminance enhancement amount, β represents the saturation boosting amount, and θ represents the amount of hue angle rotation. As one embodiment the above equation, one sets α=1, βε[1 2], and θ=0. This way, one may achieve luminance and hue preservation while enhancing the saturation of the sky region.

$\quad\begin{bmatrix} \alpha & 0 & 0 \\ 0 & {\beta\;\cos\;\theta} & {{- \beta}\;\sin\;\theta} \\ 0 & {\beta\;\sin\;\theta} & {\beta\;\cos\;\theta} \end{bmatrix}$

One benefit of adjustable color enhancement is that it allows different viewer groups to readily adjust the amount of saturation to be enhanced, some viewer group preferring more saturated colors than the others can adjust the saturation boosting amount accordingly.

The output 200 is provided to a sky score based blending 210.

The enhanced image pixel output 220 of the sky score based blending 210 is a linear combination of the original input pixel 30 and the enhanced pixel 200 adjusted by the output 230 of the filter 70. It can be expressed as: RGB_OUT(c)=skyScore(c)×RGB0_(n)(c)+(1−skyScore(c))*RGB0(c)

This equation indicates that pixels with low sky color likelihood will not be enhanced too much, and the pixels with high sky color likelihood will be heavily enhanced.

To provide the final image, the high pass image 40 is added 240 to the sky score based blended image 220.

The terms and expressions which have been employed in the foregoing specification are used therein as terms of description and not of limitation, and there is no intention, in the use of such terms and expressions, of excluding equivalents of the features shown and described or portions thereof, it being recognized that the scope of the invention is defined and limited only by the claims which follow. 

1. An image enhancement technique comprising the steps of: (a) receiving an input image and providing a low-pass filtered image that maintains a substantial number of edges therein; (b) processing said low-pass filtered image to provide respective scores for pixels of said low pass filtered image based on a likelihood map of said image denoting respective likelihoods that pixels of said image are a sky color, said likelihood map constructed by: (i) dividing a color space of said image into a plurality of areas; (ii) defining HSV values independently for each of said plurality of areas; and (iii) using the HSV values of each area to determine said likelihoods; (c) filtering said low-pass filtered image based upon a user selection to selectively enhance said sky color; (d) blending said low-pass filtered image and said filtered low-pass filtered image with one another based upon said scores; (e) combining said blended image with a high pass filtered said input image to provide an enhanced imaged.
 2. The image enhancement technique of claim 1 wherein said filter is a spatial filter.
 3. The image enhancement technique of claim 2 wherein said filter is a sigma filter.
 4. The image enhancement technique of claim 3 wherein said filter is calculated based upon ${I_{LP}\left( {x,y} \right)} = {\frac{\sum\limits_{{{{{({i,j})} \in E}\&}{{{I{({i,j})}} - {I{({x,y})}}}}} < T}^{\;}\;{I\left( {i,j} \right)}}{N\left( {x,y} \right)}.}$
 5. The image enhancement technique of claim 1 wherein said identification is based upon at least one look up table.
 6. The image enhancement technique of claim 5 wherein said at least one look up table includes a two dimensional look up table.
 7. The image enhancement technique of claim 6 wherein said at least one look up table includes a one dimensional look up table.
 8. The image enhancement technique of claim 7 wherein said at least one look up table includes at least two two dimensional look up tables and at least two one dimensional look up tables.
 9. The image enhancement technique of claim 1 wherein said identification is based upon a non-RGB color space.
 10. The image enhancement technique of claim 9 wherein said non-RGB color space is based upon saturation.
 11. The image enhancement technique of claim 10 wherein said non-RGB color space is based upon value.
 12. The image enhancement technique of claim 11 wherein said non-RGB color space is based upon hue.
 13. The image enhancement technique of claim 1 wherein said identification is based upon adjusting for low luminance blue colors.
 14. The image enhancement technique of claim 1 wherein said identification further includes a smoothing filter to smooth said identification.
 15. The image enhancement technique of claim 14 wherein said smoothing filter is a non-linear low-pass filter.
 16. The image enhancement technique of claim 15 wherein said smoothing filter is an IIR filter. 